import javax.servlet.http.*;
import java.sql.*;
import java.io.*;

public class CompanyRegistrationforjob extends HttpServlet
{
  
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException
  {

     try
       {

       String student_name=request.getParameter("student_name");
       String college_code=request.getParameter("college_code");
       String course=request.getParameter("course");
 String ssc=request.getParameter("ssc");
   String inter=request.getParameter("inter");
  String graduation=request.getParameter("graduation");
 String pg=request.getParameter("pg");

 String pg_year=request.getParameter("pg_year");
 String technical_skills=request.getParameter("technical_skills");
 
 String company_name=request.getParameter("company_name");
  String mobile=request.getParameter("mobile");
 
response.setContentType("text/html");

         PrintWriter out=response.getWriter();
        



           Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","pac","mca");


         

        
 PreparedStatement pstmt3=con.prepareStatement("insert into register_job (student_name,college_code,course,ssc,inter,graduation,pg,pg_year,technical_skills,company_name,mobile) values(?,?,?,?,?,?,?,?,?,?,?)");
         pstmt3.setString(1,student_name);
         pstmt3.setString(2,college_code);
         pstmt3.setString(3,course);
         pstmt3.setString(4,ssc);
         pstmt3.setString(5,inter);
         pstmt3.setString(6,graduation);
         pstmt3.setString(7,pg);
       pstmt3.setString(8,pg_year);
       pstmt3.setString(9,technical_skills);
       pstmt3.setString(10,company_name);
       pstmt3.setString(11,mobile);
       
       
       
  pstmt3.executeUpdate();

         
         out.println("<html>");
     
         out.println("<body>");
 
         out.println(" <font size=\"6\"> ");
         out.println("<center>");
         out.println("<table><tr><td>");
         out.println("<br> <h4><b>your registration is completed for</b></h4>");
         out.println(company_name);
         out.println("</td></tr></table></center>");
         
         out.println("</font>");

         out.println("</body>");

         out.println("</html>");   

 }
 
    catch(Exception e)
       {
         response.sendError(505,e.getMessage());
         e.printStackTrace();
       }    

  }

}  